package com.xingyi.bacs.controller;

import com.xingyi.bacs.bean.*;
import com.xingyi.bacs.service.FrService;
import com.xingyi.bacs.vo.ResponeBodyVo;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by wujt on 8/10/2021
 */
@RestController
@RequestMapping("/fr")
public class FrController {

    @Resource
    private FrService frService;

    @RequestMapping("/RJFRAccountInfo")
    public ResponeBodyVo getRJFRAccountInfo(String date){
        ResponeBodyVo responeBodyVo = new ResponeBodyVo();
        List<RJFRAccountInfo> list = frService.runRJFRAccountInfo(date);
        responeBodyVo.setData(list);
        responeBodyVo.setErrorCode(ResponeBodyVo.SUCCESS);
        return responeBodyVo;
    }

    @RequestMapping("/DLRAccountInfo")
    public ResponeBodyVo getDLRAccountInfo(String date){
        ResponeBodyVo responeBodyVo = new ResponeBodyVo();
        List<DLRAccountInfo> list = frService.runDLRAccountInfo(date);
        responeBodyVo.setData(list);
        responeBodyVo.setErrorCode(ResponeBodyVo.SUCCESS);
        return responeBodyVo;
    }

    @RequestMapping("/RJAccountSum")
    public ResponeBodyVo getRJAccountSum(String date){
        ResponeBodyVo responeBodyVo = new ResponeBodyVo();
        List<RJAccountSum> list = frService.runRJAccountSum(date);
        responeBodyVo.setData(list);
        responeBodyVo.setErrorCode(ResponeBodyVo.SUCCESS);
        return responeBodyVo;
    }

    @RequestMapping("/DLRAccountSum")
    public ResponeBodyVo getDLRAccountSum(String date){
        ResponeBodyVo responeBodyVo = new ResponeBodyVo();
        List<DLRAccountSum> list = frService.runDLRAccountSum(date);
        responeBodyVo.setData(list);
        responeBodyVo.setErrorCode(ResponeBodyVo.SUCCESS);
        return responeBodyVo;
    }

    @RequestMapping("/RjfrTxWater")
    public ResponeBodyVo getRjfrTxWater(String date){
        ResponeBodyVo responeBodyVo = new ResponeBodyVo();
        frService.deleteRjfrTxWater(date);
        List<RjfrTxWater> list = frService.runRjfrTxWater(date);
        responeBodyVo.setData(list);
        responeBodyVo.setErrorCode(ResponeBodyVo.SUCCESS);
        return responeBodyVo;
    }

    @RequestMapping("/RJAccountFlow")
    public ResponeBodyVo getRJAccountFlow(String date){
        ResponeBodyVo responeBodyVo = new ResponeBodyVo();
        frService.deleteRJAccountFlow(date);
        List<RJAccountFlow> list = frService.runRJAccountFlow(date);
        responeBodyVo.setData(list);
        responeBodyVo.setErrorCode(ResponeBodyVo.SUCCESS);
        return responeBodyVo;
    }

    @RequestMapping("/RJCzFrWater")
    public ResponeBodyVo getRJCzFrWater(String date){
        ResponeBodyVo responeBodyVo = new ResponeBodyVo();
        frService.deleteRJCzFrWater(date);
        List<RJCzFrWater> list = frService.runRJCzFrWater(date);
        responeBodyVo.setData(list);
        responeBodyVo.setErrorCode(ResponeBodyVo.SUCCESS);
        return responeBodyVo;
    }

    @RequestMapping("/RJCzFxWater")
    public ResponeBodyVo getRJCzFxWater(String date){
        ResponeBodyVo responeBodyVo = new ResponeBodyVo();
        frService.deleteRJCzFxWater(date);
        List<RJCzFxWater> list = frService.runRJCzFxWater(date);
        responeBodyVo.setData(list);
        responeBodyVo.setErrorCode(ResponeBodyVo.SUCCESS);
        return responeBodyVo;
    }

    @RequestMapping("/RJFyWater")
    public ResponeBodyVo getRJFyWater(String date){
        ResponeBodyVo responeBodyVo = new ResponeBodyVo();
        frService.deleteRJFyWater(date);
        List<RJFyWater> list = frService.runRJFyWater(date);
        responeBodyVo.setData(list);
        responeBodyVo.setErrorCode(ResponeBodyVo.SUCCESS);
        return responeBodyVo;
    }

    @RequestMapping("/RJGcWater")
    public ResponeBodyVo getRJGcWater(String date){
        ResponeBodyVo responeBodyVo = new ResponeBodyVo();
        frService.deleteRJGcWater(date);
        List<RJGcWater> list = frService.runRJGcWater(date);
        responeBodyVo.setData(list);
        responeBodyVo.setErrorCode(ResponeBodyVo.SUCCESS);
        return responeBodyVo;
    }

    @RequestMapping("/MJDetailWater")
    public ResponeBodyVo getMJDetailWater(String date){
        ResponeBodyVo responeBodyVo = new ResponeBodyVo();
        frService.deleteMJDetailWater(date);
        List<MJDetailWater> list = frService.runMJDetailWater(date);
        responeBodyVo.setData(list);
        responeBodyVo.setErrorCode(ResponeBodyVo.SUCCESS);
        return responeBodyVo;
    }

    @RequestMapping("/TbAccountInfo")
    public ResponeBodyVo getTbAccountInfo(String date){
        ResponeBodyVo responeBodyVo = new ResponeBodyVo();
        frService.deleteTbAccountInfo(date);
        List<TbAccountInfo> list = frService.runTbAccountInfo(date);
        responeBodyVo.setData(list);
        responeBodyVo.setErrorCode(ResponeBodyVo.SUCCESS);
        return responeBodyVo;
    }

    @RequestMapping("/DLRTbAccountInfo")
    public ResponeBodyVo getDLRTbAccountInfo(String date){
        ResponeBodyVo responeBodyVo = new ResponeBodyVo();
        frService.deleteDLRTbAccountInfo(date);
        List<DLRTbAccountInfo> list = frService.runDLRTbAccountInfo(date);
        responeBodyVo.setData(list);
        responeBodyVo.setErrorCode(ResponeBodyVo.SUCCESS);
        return responeBodyVo;
    }
}
